<?php 
include("inc/xhead.php");
if($_POST['id']){
	$query = "select id,shortname from sys_unit where mode=2 and usercode='".$_REQUEST['spbh']."'";
}else{
	$query = "select id,shortname from sys_unit where mode=2 and usercode like '%".$_REQUEST['spbh']."%' order by usercode";
}
$result=sqlsrv_query($conn,$query);
$id=0;
$mc="";
if($line=sqlsrv_fetch_array($result))
{
	$id=$line[0];
	$mc=$line[1];
}
sqlsrv_free_stmt($result);
echo $id."@".$mc."@";
?>
